package com.ysd.lis.controller.bac;

import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacInstrAntibDict;
import com.ysd.lis.request.bac.AddBacInstrAntibOrGermDictParam;
import com.ysd.lis.request.bac.DeleteBacInstrAntibOrGermDictParam;
import com.ysd.lis.service.bac.BacInstrAntibDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 细菌仪抗生素字典库 前端控制器
 * </p>
 *
 * @author wanghao
 * @create 2024/1/12 0012
 */
@Api(tags = "细菌仪抗生素字典库")
@RestController
@RequestMapping("/bac/bacInstrAntibDict")
public class BacInstrAntibDictController extends BaseController {

    @Autowired
    private BacInstrAntibDictService bacInstrAntibDictService;

    @ApiOperation("删除对应关系")
    @PostMapping("/deleteInstrAntibDict")
    @LogDetail(requestParam = "deleteInstrAntibDict", operationType = OperationType.DELETE, module = "细菌仪抗生素字典库", content = "删除【instrName】对应关系", businessName = "instrName")
    public Result deleteFeeItemBarCode(@RequestBody DeleteBacInstrAntibOrGermDictParam deleteBacInstrAntibOrGermDictParam) {
        return bacInstrAntibDictService.deleteInstrAntibDict(deleteBacInstrAntibOrGermDictParam);
    }

    @ApiOperation("批量保存")
    @PostMapping("/saveInstrAntibDict")
    public Result saveInstrAntibDict(@RequestBody List<BacInstrAntibDict> bacInstrAntibDicts) {
        return bacInstrAntibDictService.saveInstrAntibDict(bacInstrAntibDicts);
    }


    @ApiOperation("添加对照关系")
    @PostMapping("/addInstrAntibDict")
    @LogDetail(requestParam = "addInstrAntibDict", operationType = OperationType.INSERT, module = "细菌仪抗生素字典库", content = "增加【instrName】对应关系", businessName = "instrName")
    public Result addInstrAntibDict(@RequestBody AddBacInstrAntibOrGermDictParam addBacInstrAntibDictParam) {
        return bacInstrAntibDictService.addInstrAntibDict(addBacInstrAntibDictParam);
    }
}
